package com.deer.wms.ware.task.dao;

import com.deer.wms.project.root.mapper.SuperMapper;
import com.deer.wms.ware.task.model.Wave.WaveMaster;
import com.deer.wms.ware.task.model.Wave.WaveMasterCriteria;
import com.deer.wms.ware.task.model.Wave.WaveMasterDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ll
 */
public interface WaveMasterMapper extends SuperMapper<WaveMaster> {

    /**
     * 根据条件查询
     * @param criteria 查询条件
     * @return List<WaveMasterDto>
     */
    List<WaveMasterDto> findList(WaveMasterCriteria criteria);

    List<WaveMasterDto> allotWave(WaveMasterCriteria criteria);

    /**
     * 获取状态为"订单接收中"的最新波次
     * @param waveTacticCode 波次编码
     * @return WaveMaster
     */
    WaveMaster getLast(@Param("waveTacticCode") String waveTacticCode);

    /**
     * 获取波次下的SKU数量
     * @param waveMasterId 波次ID
     * @param soMasterId SO单ID
     * @return List<Integer>
     */
    List<Integer> countSku(@Param("waveMasterId")Integer waveMasterId,@Param("soMasterId")Integer soMasterId);
}